var app = getApp();
Page({
  data: {
    
  },
  btnPlay:function(){
    wx.playBackgroundAudio({
      dataUrl: 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46',
      success:function(res){
        console.log(res)
      },
      fail:function(){},
      complete:function(){}
    })
  },
  btnGetInfo:function(){
    wx.getBackgroundAudioPlayerState({
      success:function(res){
        console.log(res);
      },
      fail:function(){},
      complete:function(){}
    })
  },
  btnPause:function(){
    wx.pauseBackgroundAudio({
      success:function(res){
        console.log(res);
      },
      fail: function () {},
      complete: function () {}
    })
  },
  btnStop:function(){
    wx.stopBackgroundAudio()
  },
  goto:function(){
    wx.navigateTo({
      url: '../../pages/logs/logs'
    })
  },
  onLoad: function (options) {
    
  },
  onReady: function () {
    wx.onBackgroundAudioPlay(function(){
      console.log('播放了！');
    })
    wx.onBackgroundAudioPause(function(){
      console.log('播放暂停了！');
    })
    wx.onBackgroundAudioStop(function(){
      console.log('播放停止了！');
    })
  },
})